home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------//
-
- // Synopsis: Additive sequence.
-
- // Syntax: seqa ( A , B , N )
-
- // Description:
-
- // Produces a row vector comprising N equally spaced numbers
- // starting at A and finishing at B. If N is omitted then 10
- // points are generated.
-
- // This file is a translation of seqa.m from version 2.0 of
- // "The Test Matrix Toolbox for Matlab", described in Numerical
- // Analysis Report No. 237, December 1993, by N. J. Higham.
-
- //-------------------------------------------------------------------//
-
- seqa = function ( a , b , n )
- {
- if (!exist(n)) { n = 10; }
-
- if (n <= 1)
- {
- return [a];
- }
-
- return [a+(0:n-2)*(b-a)/(n-1), b];
- };
-